var page = require('webpage').create();
console.log('The default user agent is ' + page.settings.userAgent);
page.settings.userAgent = 'SpecialAgent';
page.open('http://www.httpuseragent.org', function (status) {
    if (status !== 'success') {
        console.log('Unable to access network');
    } else {
        var ua = page.evaluate(function () {
            return document.getElementById('myagent').textContent;
        });
        console.log(ua);
    }
    phantom.exit();
});

// let d='';
// let c=document.querySelectorAll('#topic_list .topic_title');
// let len=c.length;
// for(let i=0;i<len;i++){
//   d=d+c[i].title+'\n'
//   // d.push({
//   //   title:c[i].title,
//   //   href:c[i].href
//   // })
// }
// .querySelectorAll('.index-item a')
// return d;
